let ((add : (int*int*int*int) -> unit),
     (get_altitude : (int*int*int) -> int),
     (get_color : int -> (float*float*float))) =
  let h_a = Hashtbl.create 11 in
  let h_c = Hashtbl.create 11 in
  ((function (r,g,b,a) ->
    begin
      Hashtbl.add h_a (r,g,b) a;
      Hashtbl.add h_c a (r,g,b);
    end),
   (function (r,g,b) -> 
     try
       Hashtbl.find h_a (r,g,b)
     with
	 Not_found -> 
	   print_string "ColorList : altitude not found";
	   0),
   (function a ->
     try
       let (r,g,b) = Hashtbl.find h_c a in
       ((float_of_int r) /. 255., (float_of_int g) /. 255.,
        (float_of_int b) /. 255.)
     with
	 Not_found ->
	   print_string "ColorList : color not found\n";
	   (0.,0.,0.)))
    
let (add_altitude, get_altitude_list) =
  let altitude_list = ref [] in
  ((function a ->
    let a = int_of_string a in
    altitude_list := a::!altitude_list),
   (function () -> altitude_list))
